﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace bai_2thuchanh3
{
    class preson
    {
        public string name;
        public string age;
        private string nationality;
        public void nhap()// mo cai notepad lne                 
        {
            Console.Write("nhap name:");
            name = Console.ReadLine();
            Console.Write("nhap age :");
            age = Console.ReadLine();
            Console.Write(" nhap nationality:");
            nationality = Console.ReadLine();
        }
        public void xuat()
        {
            Console.WriteLine("name:{0},age:{1},nationality:{2}", name, age, nationality);
        }
    }
      public  class player:preson
        {
            private int number;
            private int position;
            private string team;
            public new void nhap()
            {
                Console.Write(" nhap number:");
                number = int.Parse(Console.ReadLine());
                Console.Write(" nhap position:");
                position = int.Parse(Console.ReadLine());
                Console.Write(" nhap team");
                team = Console.ReadLine();
            }
            public new void xuat()
            {
                Console.WriteLine("number:{0},position:{1},team:{2}", number, position, team);
            }
      }
            class coach:preson
            {
                private float year;
                public new void nhap()
                {
                    Console.Write(" nhap so year:");
                    year=float.Parse(Console.ReadLine());
                }
                public new void xuat()
                {
                    Console.WriteLine(" year:{0}",year);
                }
            }
               class teams: coach, player    //xem lai da ke thua
                {
                    private string names;           
                    private string listOplayer;
                    private string coach;
                    public new void nhap()
                    {
                        Console.Write(" nhap gia tri name:");
                        names=Console.ReadLine();
                        Console.Write(" nhap gia tri cua listOplayer:");
                        listOplayer=Console.ReadLine();
                        Console.Write("nhap gia tri coach:");
                        coach=Console.ReadLine();
                    }
                    public new void xuat()
                    {
                        Console.WriteLine("name:{0},listoplayer:{1},coach:{2}",names,listOplayer,coach);
                    }
                }
                //class team : player
                //{
                //    private string list;
                //    public new void nhap()
                //    {
                //        Console.Write(" nhap gia tri cua list:");
                //        list = Console.ReadLine();
                //    }
                //    public new void xuat()
                //    {
                //        Console.WriteLine("list:{0}", list);
                //    }
                //}


    }

   

